#coding=utf-8
import random
file = open("list1.txt")
context = []
tmp =""
flag = True
def isNum(value):
	try:
		x = int(value)
		return True
	except :
		return False
      
for eachline in file:
	each = eachline.split('.')
	if isNum(each[0]):
		print each[0]
		context.append(tmp)
		tmp = each[1]
	else:
		tmp = tmp + "\n" + eachline
				
context = random.sample(context ,len(context))
print "total is:"
print  len(context)
file2 = open ( 'list2.txt', 'w' )
i = 1 
for eachline in context:
	#each = eachline.split('.')
	#print each[0]
	file2.write(str(i)+"."+eachline)
	i = i+1
file2.close()  